package com.open.api.wechat.common;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * @author : zhaoxuan
 * @version : 1.0
 * @date : 2021/6/30 23:11
 * @description : CommonResponse
 */
@Data
public class WeChatCommonResponse {

    private static final int SUCCESS = 0;

    public static final String DEFAULT_TIME_OUT_RESPONSE = "{\"errcode\":100,\"errmsg\":\"请求超时\"}";

    /**
     * 错误码
     */
    @JsonProperty("errcode")
    private int code;

    /**
     * 错误信息
     */
    @JsonProperty("errmsg")
    private String message;

    @JsonIgnore
    public Boolean isSuccess(){
        return code == SUCCESS;
    }
}
